#include "udp_consumer.hpp"
#include <memory>
// ./udp_consumer.hpp  ip  port

static void Uages()
{
    std::cout <<"Uages.tip :" << "./udp_comsumer.exe  severip  severport" << std::endl;
}

int main(int argc,char *arvg[])
{
    if(argc != 3)
    {
        Uages();
        exit(4);
    }
    
    std::string ip = arvg[1];
    //这种正式就可以直接用atoi 但是 sockaddr_in 结构体里面的不行
    uint16_t port = atoi(arvg[2]);
     
    std::unique_ptr<Consumer> consumer(new Consumer(ip,port));

    consumer->initconsumer();
    consumer->start();
    return 0;
}